mixin Piloted {
  int astronauts = 1;

  void describeCrew() {
    print('Number of astronauts: $astronauts');
  }
}

class Spacecraft {
  String name;
  DateTime? launchDate;

  Spacecraft(this.name, this.launchDate);

  void describe() {
    print('航天器: $name');
    if (launchDate != null) {
      print('发射日期: $launchDate');
    } else {
      print('未发射');
    }
  }
}

class MannedSpacecraft extends Spacecraft with Piloted {
  MannedSpacecraft(super.name, DateTime super.launchDate);
}

void main() {
  var apollo = MannedSpacecraft('Apollo 11', DateTime(1969, 7, 16));
  apollo.describe();
  apollo.describeCrew();
}
